<?php

//No direct access

defined('_JEXEC') or die('Restricted access');

?>

<div id="ownservices">


 <div id="mainmenuownservice"><?php echo MenuHelper::nav(); ?></div>


<div id="mainownservice">
<h3>
	<?php 
		echo $this->params->get('page_title'); 
	?>
</h3>
<hr />
<?php $row = $this->row; ?>
<script language="javascript" type="text/javascript">
	<!--
		function submitbutton(pressbutton)
		{
			var form = document.adminForm;

			if (pressbutton == 'cancel') {
				submitform( pressbutton );
				return;
			}
			if (form.fee.value == ""){
				alert( "<?php echo JText::_( 'OWNSERVICE_PLEASE_INPUT_FEE', true ); ?>" );
			} else if(form.from.value == ""){
				alert( "<?php echo JText::_( 'OWNSERVICE_PLEASE_INPUT_FROM', true ); ?>" );
			} else if(form.to.value == ""){
				alert( "<?php echo JText::_( 'OWNSERVICE_PLEASE_INPUT_TO', true ); ?>" );
			} else {
				submitform( pressbutton );
			}
		}
	//-->
</script>
<form action="index.php?option=com_ownservice" method="post" name="adminForm">
	<table class="admintable">
		<tr>
			<td class="key"><?php echo JText::_('OWNSERVICE_AMOUNT_TRANSFER'); ?></td>
			<td>
				<?php echo JText::_('OWNSERVICE_FROM'); ?><input type="text" name="from" id="from" value="<?php echo $row->from; ?>" class="inputbox" size="10" />AUD
			</td>
			<td>
				<?php echo JText::_('OWNSERVICE_TO'); ?><input type="text" name="to" id="to" value="<?php echo $row->to; ?>" class="inputbox" size="10" />AUD
			</td>
			<td>
				<?php echo JText::_('OWNSERVICE_FEE'); ?>
				<input type="text" name="fee" id="fee" value="<?php echo $row->fee; ?>" class="inputbox" size="10" /> 
				<?php 
					if($this->type == 'fee'){
						echo 'AUD';
					} else {
						echo $this->rate->code;
					} 
				?>
			</td>
		</tr>
		<tr>
			<td colspan="4" align="center"><hr /></td>
		</tr>
		<tr>
			<td colspan="4" align="center">
			<input type="button" name="save" value="<?php echo JText::_('OWNSERVICE_SAVE'); ?>" onClick="javascript: submitbutton('save')" />
			<input type="button" name="cancel" value="<?php echo JText::_('OWNSERVICE_CANCEL'); ?>" onClick="javascript: submitbutton('cancel')" />
			</td>
		</tr>
	</table>
	<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
	<input type="hidden" name="rate_id" value="<?php echo $this->rate_id; ?>" />
	<input type="hidden" name="type" value="<?php echo $this->type; ?>" />
	<input type="hidden" name="option" value="com_ownservice" />
	<input type="hidden" name="task" value="save" />
	<input type="hidden" name="Itemid" value="<?php echo JRequest::getVar('Itemid'); ?>" />
	<input type="hidden" name="controller" value="fee" />
	<input type="hidden" name="view" value="fee" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
</div>
</div>